





#include "font_manager.h"
#include <string.h>
#include <stdio.h>

static fontoperation_p g_fontlibdevs;
static fontoperation_p g_fontlibdefaulter;


void RegsiterFontlib(fontoperation_p fontoperationp)
{

	fontoperationp->ptNEXT = g_fontlibdevs;

	g_fontlibdevs = fontoperationp;

}



int selectdefaulterFontlib(char * name)
{

	fontoperation_p ptmp = g_fontlibdevs;

	while(ptmp)
	{
		
		if(strcmp(ptmp->name ,name)==0)
		{
			g_fontlibdefaulter = ptmp;
			return 0;
		}
		ptmp = ptmp->ptNEXT;
	}
	return -1;	

}





//初始化库
int initdefaulterFontlib(char * finename)
{

	return g_fontlibdefaulter->FontInit(finename);
	





}



void  SetFontSize(int fontsize)
{


	printf("%s %s %d\n", __FILE__, __FUNCTION__, __LINE__);

	g_fontlibdevs->SetFontSize(fontsize);

	


}



int GetFontBitMap(unsigned int  dwcode, fontbitmap_p fontbitmapp)
{

	return g_fontlibdefaulter->GetFontBitMap(dwcode, fontbitmapp);

	


}




//初始化系统
void FontlibInit(void )
{
	extern  void freetypeRegsiter(void);

	freetypeRegsiter();

}




































